<?php
// XXX need to deal with multiple versions of the same mod.

require_once './lconfig.php';
require_once dbget_path( 'mod', 'confizuz' );
require_once dbput_path( 'mod', 'confizuz' );

$mftype = $GLOBALS["${pre}NAV"]['MOD_FILE_TYPE'];
$mftlen = strlen($mftype);

foreach( $GLOBALS["${pre}MOD"]['MOD'] as $mod )
  $modxml[$mod] = mod_readinfo( mod_path($mod,'info',$mftype) );

foreach($modxml as $mod) {
  echo $mod['name'], ' ', $mod['ver'];
  if( count( $mod['depends'] ) > 0 ) {
    foreach($mod['depends'] as $depmod => $depver) {
      list($verlow, $verhi) = explode('-', $depver);
      echo ' :: ', $depmod, ' bet ', $verlow, ' and ', $verhi; 
    }
  }
  echo "\r\n<br />";
}

setModStatus('foobaz', '0.0.1', 1);
print_r(getInstalledMods());

function mod_readinfo( $infof ) {
  return parse_ini_file( $infof, 1 );
}

?>
